﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="TE_Subject_Success_Policy.aspx.cs" Inherits="School.Pages.Teaching.TE_Subject_Success_Policy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
        &nbsp;<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </div>
    <div class="devheader">
        سياسة النجاح للمادة
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnlSearch" CssClass="clr fieldsettd" runat="server" BorderColor="Black"
                BorderStyle="Outset" BorderWidth="1px">
                <fieldset>
                    <div id="hideshow">
                        <div class="col1">
                            <ul>
                                <li>المجمع
                                    <div class="field">
                                        <asp:DropDownList ID="ddlCampus" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                            DataTextField="Name" DataValueField="Id" OnTextChanged="ddlCampus_TextChanged"
                                            Width="150px">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlCampus"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>الشهاده
                                    <div class="field">
                                        <asp:DropDownList ID="ddlCertificate" runat="server" AppendDataBoundItems="True"
                                            AutoPostBack="True" DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlCertificate_SelectedIndexChanged"
                                            Width="150px" TabIndex="1">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="ddlCertificate"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>المرحله
                                    <div class="field">
                                        <asp:DropDownList ID="ddlStadge" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                            DataTextField="Name" DataValueField="Id" OnSelectedIndexChanged="ddlStadge_SelectedIndexChanged"
                                            Width="150px" TabIndex="2">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="ddlStadge"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>الصف
                                    <div class="field">
                                        <asp:DropDownList ID="ddlGrade" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                                            DataValueField="Id" Width="150px" TabIndex="3" AutoPostBack="True" OnSelectedIndexChanged="ddlGrade_SelectedIndexChanged">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="ddlGrade"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                            </ul>
                        </div>
                        <div class="col2">
                            <ul>
                                <li>المادة
                                    <div class="field">
                                        <asp:DropDownList ID="ddlsubject" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                            DataTextField="Sub_name" DataValueField="Id" OnSelectedIndexChanged="ddlsubject_SelectedIndexChanged"
                                            Width="150px">
                                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                                        </asp:DropDownList>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="ddlsubject"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>الدرجة الكبري
                                    <div class="field">
                                        <asp:TextBox ID="txtMax" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ControlToValidate="txtMax"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                                <li>الدرجة الصغري
                                    <div class="field">
                                        <asp:TextBox ID="txtMin" runat="server"></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="txtMin"
                                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="st">*</asp:RequiredFieldValidator>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                </fieldset>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <div>
        <div class="col1">
            <ul>
                <li>الاختبار
                    <div class="field">
                        <asp:DropDownList ID="ddlExam" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                            DataValueField="Id" Width="150px" DataSourceID="EDddlExam">
                            <asp:ListItem Value="0">اختيار</asp:ListItem>
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlExam"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="st" InitialValue="0">*</asp:RequiredFieldValidator>
                        <asp:EntityDataSource ID="EDddlExam" runat="server" ConnectionString="name=SchoolEntities"
                            DefaultContainerName="SchoolEntities" EnableFlattening="False" EntitySetName="TE_Offline_Exam"
                            Select="it.[Id], it.[Name]">
                        </asp:EntityDataSource>
                    </div>
                </li>
                <li>
                    <div class="field">
                        <asp:Button ID="btnAdd" runat="server" Text="إضافــــة" ValidationGroup="st" OnClick="btnAdd_Click" />
                    </div>
                </li>
            </ul>
        </div>
        <div class="col2">
            <ul>
                <li>نسبة من درجة المادة
                    <div class="field">
                        <asp:TextBox ID="txtpercent" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtpercent"
                            Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="st">*</asp:RequiredFieldValidator>
                    </div>
                </li>
                <li>
                    <div class="field">
                        <asp:Label ID="lbltest" runat="server" Text="" Visible="False"></asp:Label>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <fieldset runat="server" id="fsExam" style="border: 1px solid #CCC; clear: both"
        visible="False">
        <legend>اضافة اختبارات</legend>
        <div style="clear: both">
            <ul>
                <li>
                    <div class="field">
                        <asp:GridView ID="gvExam" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                            AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Sub_Id,Exam_Id" FooterStyle-CssClass="GridHeaderFooter"
                            HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" Width="80%"
                            OnRowDeleting="gvExam_RowDeleting">
                            <AlternatingRowStyle CssClass="GridItemAltername" />
                            <Columns>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        م
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="Sub" HeaderText="المادة" />
                                <asp:TemplateField HeaderText="الاختبار" SortExpression="Exam">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Exam") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="Exam" runat="server" Text='<%# Bind("Exam") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="النسبة" SortExpression="Per">
                                    <EditItemTemplate>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Per") %>'></asp:Label>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblper" runat="server" Text='<%# Bind("Per") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:CommandField DeleteText="حــذف" ShowDeleteButton="True">
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                </asp:CommandField>
                            </Columns>
                            <FooterStyle CssClass="GridHeaderFooter" />
                            <HeaderStyle CssClass="GridHeaderFooter" />
                            <PagerStyle CssClass="GridPager" />
                        </asp:GridView>
                    </div>
                </li>
                <li>
                    <div class="field">
                        <asp:Button ID="btnsave" runat="server" Text="حفـــــظ" OnClick="btnsave_Click" />
                    </div>
                </li>
                <li>
                    <div class="field">
                        <asp:Label ID="lbltst" runat="server" Visible="False"></asp:Label>
                    </div>
                </li>
            </ul>
        </div>
    </fieldset>
    <div style="padding: 5px">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:Label ID="lblgrid" runat="server" Visible="False"></asp:Label>
                <br />
                <fieldset id="exam_sub" runat="server" visible="False" style="border: 1px solid #CCC;
                    clear: both">
                    <legend>الاختبارات الخاصه بالمادة</legend>
                    <asp:GridView ID="gv_Exam_Sub" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                        AutoGenerateColumns="False" CssClass="Grid" 
                        DataKeyNames="Id,Id_Policy,Exam_Id" FooterStyle-CssClass="GridHeaderFooter"
                        HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" Width="80%"
                        OnRowDeleting="gv_Exam_Sub_RowDeleting" 
                        onrowcancelingedit="gv_Exam_Sub_RowCancelingEdit" 
                        onrowediting="gv_Exam_Sub_RowEditing" onrowupdating="gv_Exam_Sub_RowUpdating">
                        <AlternatingRowStyle CssClass="GridItemAltername" />
                        <Columns>
                            <asp:BoundField DataField="Subject_Name" HeaderText="المادة" SortExpression="Subject_Name" />
                            <asp:BoundField DataField="Name" HeaderText="الاختبار" SortExpression="Name" />
                            <asp:TemplateField HeaderText="الدرجة العظمي" SortExpression="Max_degree">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtmax" runat="server" Text='<%# Bind("Max_degree") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Max_degree") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="الدرجة الصغري" SortExpression="Min_degree">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtmin" runat="server" Text='<%# Bind("Min_degree") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Min_degree") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Parcent" HeaderText="النسبة" 
                                SortExpression="Parcent" />
                            <asp:CommandField CancelText="الغاء" EditText="تعديل" ShowEditButton="True" 
                                UpdateText="تحديث" />
                            <asp:CommandField DeleteText="حــذف" ShowDeleteButton="True" />
                        </Columns>
                        <FooterStyle CssClass="GridHeaderFooter"></FooterStyle>
                        <HeaderStyle CssClass="GridHeaderFooter"></HeaderStyle>
                        <PagerStyle CssClass="GridPager"></PagerStyle>
                    </asp:GridView>
                </fieldset>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
